package org.example.Model;

public class Client {
    public static void main(String[] args) {
        //生成名为bird1的Pigeon
        Bird bird1 = new Pigeon();
        //赋予Pigeon飞的行为
        bird1.setFlyBehaviour(new FreeFly());
        //飞
        bird1.display();

        //生成名为bird2的Eagle
        Bird bird2 = new Eagle();
        //赋予Pigeon飞的行为
        bird2.setSwimBehaviour(new UnableSwim());
        //飞
        bird2.display();

        //生成名为bird1的Pigeon
        Bird bird3 = new Penguin();
        //赋予Pigeon飞的行为
        bird3.setSwimBehaviour(new AbleSwim());
        //飞
        bird3.display();
    }
}